//
//  ViewController.m
//  LikelyTarbar
//
//  Created by Ju on 15/3/30.
//  Copyright (c) 2015年 juwenz. All rights reserved.
//

#import "ViewController.h"
#import "LikelyTarbar.h"
@interface ViewController ()<LikelyTarbarDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupTarbar];
}
- (void)setupTarbar
{
    LikelyTarbar *tabBar = [[LikelyTarbar alloc] initWithFrame:self.view.frame];
    tabBar.delegate = self;
    tabBar.selectedType = 1;
    
    NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:4];
    
    LikelyTabIconModel *timetable = [[LikelyTabIconModel alloc] init];
    timetable.imageName = @"home";
    timetable.title = @"Home";//Proglam Schedule
    timetable.highlightedImageName = @"home";
    timetable.type = LTTabIconTypeSecond;
    [array addObject:timetable];
    
    LikelyTabIconModel *proglam = [[LikelyTabIconModel alloc] init];
    proglam.imageName = @"featured";
    proglam.title = @"Featured";
    proglam.highlightedImageName = @"featured";
    proglam.type = LTTabIconTypeThird;
    [array addObject:proglam];
    
    LikelyTabIconModel *yanzhe = [[LikelyTabIconModel alloc] init];
    yanzhe.imageName = @"message";
    yanzhe.title = @"Message";
    yanzhe.highlightedImageName = @"message";
    yanzhe.type = LTTabIconTypeFourth;
    [array addObject:yanzhe];
    
    LikelyTabIconModel *schedule = [[LikelyTabIconModel alloc] init];
    schedule.imageName = @"music";
    schedule.title = @"Music";
    schedule.highlightedImageName = @"Music";
    schedule.type = LTTabIconTypeFifth;
    [array addObject:schedule];
    
    [tabBar setIcons:array];
    tabBar.backgroundColor = [UIColor blackColor];
    [self.view addSubview:tabBar];
}

- (void)tabBar:(LikelyTarbar *)tabBar selectedAtType:(NSInteger)type
{
    NSLog(@"%d",type);
}

@end
